package com.gwtintegration.smartrfsandbox.server.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gwtintegration.smartrf.server.DataRequest;
import com.gwtintegration.smartrfsandbox.server.data.CityDataResponse;
import com.gwtintegration.smartrfsandbox.server.entity.CityEntity;
import com.gwtintegration.smartrfsandbox.server.repository.CityRepository;

@Service
@Transactional
public class CityService {

	@Autowired
	private CityRepository cityRepository;

	@Transactional(readOnly = true)
	public CityDataResponse fetch(DataRequest dataRequest) {
		return cityRepository.fetch(dataRequest);
	}

	public CityEntity add(CityEntity entity) {
		return cityRepository.add(entity);
	}

	public CityEntity update(CityEntity entity) {
		return cityRepository.update(entity);
	}

	public void remove(CityEntity entity) {
		cityRepository.remove(entity);
	}

}
